package com.lzw.service.impl.supplier;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.lzw.mapper.supplier.SupplierReturns2Mapper;
import com.lzw.pojo.SupplierReturns;
import com.lzw.service.supplier.SupplierReturns2Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.List;

@Service
public class SupplierReturns2ServiceImpl implements SupplierReturns2Service {

    @Autowired
    private SupplierReturns2Mapper supplierReturns2Mapper;

    @Override
    public List<SupplierReturns> list(Integer pageNum, Integer pageSize, String supplier, String medicine, LocalDate returnDate) {
        PageHelper.startPage(pageNum,pageSize);
        List<SupplierReturns> list = supplierReturns2Mapper.list(supplier, medicine, returnDate);
        Page<SupplierReturns> supplierReturns = (Page<SupplierReturns>) list;
        return supplierReturns;
    }
}
